{extend name="../../admin/view/main"}

{block name="button"}

{if auth("groupAdd")}
<button data-modal='{:url("groupAdd")}' class='layui-btn layui-btn-sm layui-btn-primary'>添加新活动</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow table-block">
    {include file='index/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th width="20px" class='text-left nowrap'>活动ID</th>
            <th width="180px" class='text-left nowrap'>活动海报</th>
            <th width="420px" class='text-left nowrap'>产品信息</th>
            <th width="180px" class='text-left nowrap'>活动时间</th>
            <th width="180px" class='text-left nowrap'>活动二维码</th>
            <th width="180px" class='text-left nowrap'>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>
                {$vo.id}
            </td>
            <td class='text-left nowrap'>
                <img alt="" src="{$vo.cover|default=''}" data-tips-image class="inline-block text-top margin-right-5"
                     style="width:60px;height:60px">
            </td>
            <td class='text-left nowrap'>
                {$vo.act_name}
            </td>
            <td class="nowrap">
                <div>开始时间：{$vo.act_start_time|format_datetime|str_replace=' ','<br>时间：',###|raw}</div>
                <div>结束时间：{$vo.act_end_time|format_datetime|str_replace=' ','<br>时间：',###|raw}</div>
            </td>

            <td class='text-left nowrap'>
                <img alt="" src="{:url('wechat/api.test/showQrc',['id'=>$vo.id])}" data-tips-image
                     class="inline-block text-top margin-right-5"
                     style="width:60px;height:60px">
            </td>

            <td class='text-left nowrap'>
                {eq name='vo.is_forbid' value='1'}
                <span class="layui-badge">已禁用</span>
                {else}
                <span class="layui-badge layui-bg-green">启用</span>
                {/eq}
                <br>
            </td>

            <td class="nowrap">
                {if auth('black_add') and $vo.is_forbid eq 0}
                <a class="layui-btn layui-btn-sm" data-action="{:url('black_add')}" data-value="id#{$vo.id}"
                   data-csrf="{:systoken('black_add')}">
                    禁 用
                </a>
                {/if}

                {if auth('black_del') and $vo.is_forbid eq 1}
                <a class="layui-btn layui-btn-sm" data-action="{:url('black_del')}" data-value="id#{$vo.id}"
                   data-csrf="{:systoken('black_del')}">
                    启 用
                </a>
                {/if}

                {if auth('groupAdd')}
                <a class="layui-btn layui-btn-sm" data-title="编辑拼团" data-modal='{:url("groupAdd")}?id={$vo.id}'>编 辑</a>
                {/if}
                   <a class="layui-btn layui-btn-sm" data-title="参 团" data-modal='{:url("group/groupAdd")}?id={$vo.id}'>参 团</a>
                    <a class="layui-btn layui-btn-sm" data-title="开 团" data-modal='{:url("group/groupAdd")}'>开 团</a>
                    <a class="layui-btn layui-btn-sm" data-title="团购管理" data-modal='{:url("groupAdd")}?id={$vo.id}'>团购管理</a> 
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
